import request from '@/utils/request'
import cache from "@/plugins/cache";

// 查询变量分组列表
export function listGroup(query) {
  return request({
    url: '/system/group/list',
    method: 'get',
    params: query
  })
}

// 查询变量分组详细
export function getGroup(id) {
  return request({
    url: '/system/group/' + id,
    method: 'get'
  })
}

// 新增变量分组
export function addGroup(data) {
  return request({
    url: '/system/group',
    method: 'post',
    data: data
  })
}

// 修改变量分组
export function updateGroup(data) {
  return request({
    url: '/system/group',
    method: 'put',
    data: data
  })
}

// 删除变量分组
export function delGroup(id) {
  return request({
    url: '/system/group/' + id,
    method: 'delete'
  })
}

export function getDbName() {
  return cache.local.get("currentProject");
}

// 查询设备类型管理列表
export function listDrTypeInfo(query) {
  return request({
    url: '/system/group/listDrTypeInfo',
    method: 'get',
    params: query
  })
}
